﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Phone.Framework.Controls;

namespace CetWin.Views
{
    public partial class AlphaSelector : UserControl
    {
        public AlphaSelector()
        {
            InitializeComponent();
        }

        private void Border_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            var control = new WindowsPhoneControl1();
            control.itemsControl.SelectionChanged += new SelectionChangedEventHandler(itemsControl_SelectionChanged);
            prompt = Prompt.Show("", control);
        }
        Coding4Fun.Phone.Controls.MessagePrompt prompt;
        void itemsControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            selectedAlpha_Element.Text=e.AddedItems[0].ToString();
            SelectedAlpha = selectedAlpha_Element.Text.ToLower();
            prompt.Hide();
        }

        public string SelectedAlpha
        {
            get { return (string)GetValue(SelectedAlphaProperty); }
            set { SetValue(SelectedAlphaProperty, value); }
        }

        public static readonly DependencyProperty SelectedAlphaProperty =
            DependencyProperty.Register("SelectedAlpha", typeof(string), typeof(AlphaSelector), 
            new PropertyMetadata(string.Empty));

    }
}